const Router = require("koa-router");
const router = new Router({ prefix: "/goods" });
const { create, findAll,upload,update,doneOrder ,updateOneBill,delGoods} = require("../controller/goods");
// const { verifyToken,hasAdminPer } = require("../middleware/user.middleware");
// const {  validator,} = require("../middleware/goods.middleware");

// router.post("/upload", verifyToken, hasAdminPer,upload);
router.post("/upload", upload);
router.post("/", create);
router.put('/',update)
router.get("/", findAll);
router.post('/doneorder',doneOrder)
router.post('/updateGoodsOne',updateOneBill)
router.delete('/:id',delGoods)
// router.post('/add',validator,create)
// router.post('/update/:id',update)
// // router.post('/remove/:id',remove)  // 硬删除
// router.post('/remove/on/:id',restore)
// router.post('/remove/off/:id',destore)
// router.get('/',findAll)
module.exports = router;
